import http from '../utils/http'

export interface Statistic {
    totalInvoiceCount: number,
    totalInvoiceAmount: number,
    totalInvoiceAmountOpened: number,
    totalInvoiceAmountUnopened: number,
    sfInvoiceCount: number,
    hfInvoiceCount: number,
    invoiceCountRanking: StatisticRank[],
    invoiceAmountRanking: StatisticRank[],
    userCount: number,
    templateCount: number
}

export interface StatisticRank {
    customerName: string,
    invoiceCount: number,
    invoiceAmount: number
}

export function getStatistic() {
    return http.post<Statistic>('/statistic/getStatistic')
}